package cn.upfinder.allvideo.Adapter;

import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;

import java.util.List;

import cn.upfinder.allvideo.R;
import cn.upfinder.datalibrary.Bean.VideoEntity;
import cn.upfinder.uilibrary.Adapter.BaseQuickAdapter;
import cn.upfinder.uilibrary.Adapter.BaseViewHolder;

/**
 * Created by upfinder on 2016/11/26.
 */

public class MovieListAdapter extends BaseQuickAdapter<VideoEntity> {
    private static final String TAG = MovieListAdapter.class.getSimpleName();


    public MovieListAdapter(int layoutResId, List<VideoEntity> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, VideoEntity item) {
        Glide.with(mContext)
                .load(item.getImgUrl())
                .error(R.mipmap.ic_launcher)
                .placeholder(R.mipmap.ic_launcher)
                .into((ImageView) helper.getView(R.id.ivVideoImg));

        ((TextView) helper.getView(R.id.tvVideoTitle)).setText(item.getName());
        ((TextView) helper.getView(R.id.tvVideoType)).setText(item.getType());

    }
}
